package com.winchain.chainbill.bill.biz.query.vo;

import com.winchain.chainbill.bill.base.po.CbHldr;
import com.winchain.chainbill.bill.base.po.CbRec;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Transient;

public class BillNode extends CbHldr {
	@Column(name = "bill_code")
	private String billCode;
	@Column(name = "bill_amt")
	private BigDecimal billAmt;
	@Column(name = "prnt_id")
	private String prntId;
	@Column(name = "snd_date")
	private String sndDate;
	@Transient
	private List<BillNode> children;

	public BillNode() {
	}

	public BillNode(CbRec record, CbHldr holder) {
		setBillCode(record.getBillCode());
		setBillAmt(record.getBillAmt());
		setHoldId(holder.getHoldId());
		setBillId(holder.getBillId());
		setHldrId(holder.getHldrId());
		setHldrNm(holder.getHldrNm());
		setHldrAcct(holder.getHldrAcct());
		setRcvDate(holder.getRcvDate());
		setHldrLvl(holder.getHldrLvl());
		setSndDate(record.getSndDate());
	}

	public String getBillCode() {
		return this.billCode;
	}

	public void setBillCode(String billCode) {
		this.billCode = billCode;
	}

	public BigDecimal getBillAmt() {
		return this.billAmt;
	}

	public void setBillAmt(BigDecimal billAmt) {
		this.billAmt = billAmt;
	}

	public String getPrntId() {
		return this.prntId;
	}

	public void setPrntId(String prntId) {
		this.prntId = prntId;
	}

	public List<BillNode> getChildren() {
		return this.children;
	}

	public String getSndDate() {
		return this.sndDate;
	}

	public void setSndDate(String sndDate) {
		this.sndDate = sndDate;
	}

	public void setChildren(List<BillNode> children) {
		this.children = children;
	}

	public void addChild(BillNode node) {
		if (this.children == null) {
			this.children = new ArrayList();
		}
		this.children.add(node);
	}
}
